#include "Arduino.h"
#include "Pin_Model.h"

Pin_Model::Pin_Model(int pin_id)
{
  _pin_id = pin_id;
}

void Pin_Model::set_pin_high(){
  digitalWrite(_pin_id, HIGH);   // turn the LED on (HIGH is the voltage level)  
}

void Pin_Model::set_pin_low(){
  digitalWrite(_pin_id, LOW);
}

// 0 = in, 1 = out
void Pin_Model::set_pin_mode(int mode){
  if(mode == 0){
    pinMode(_pin_id, INPUT);
  }else if(mode == 1){
    pinMode(_pin_id, OUTPUT);
  }else{
    // Handle Error condition: mode not supported!
  }
}

int Pin_Model::get_pin_id(){
  return _pin_id;
}
